layui.use(['jquery','layer','table','form'],function(){
    var $=layui.jquery;
    var layer=layui.layer;
    var form = layui.form;

    $('#cancel').click(function () {
        var layer = parent.layer;
        layer.close(layer.index)
    });
    //微圈分类赋值
    $.ajax({
        url: '/examine/getActicleCategroy',
        dataType: 'json',
        type: 'post',
        success: function (data) {
            var categroy = data.data;
            for (var i = 0; i < categroy.length; i++) {
                $('#categroyName').append('<option value="' + categroy[i].artcleCategroyName + '" >' + categroy[i].artcleCategroyName + '</option>')
            }
            form.render('select');
        }
    });
    form.on('submit(sub)',function () {
        var artcleTitle = $("input[name=artcleTitle]").val();
        var createName = $("input[name=createName]").val();
        var categroyName = $("#categroyName option:selected").text();
        var details = $("#details option:selected").val();
        $.ajax({
            url:"/examine/getMicrocircle",
            type:"post",
            dataType:"json",
            data:{'artcleTitle':artcleTitle,'categroyName':categroyName,'createName':createName,'details':details,'result':'','type':4},
            success:function (data) {
                parent.advancedSearch(data.data);
                var layer = parent.layer;
                layer.close(layer.index);
            }
        })
        return false;
    });
})